﻿import QtQuick 2.0
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import ConfigElementType 1.0
import "qrc:/qmlComponents/ConfigManager"
import "qrc:/qmlComponents/AxisModulePos"
import "qrc:/qmlComponents/VisionViewer"
import "qrc:/qmlComponents/CustomizedUIElement"

Item {
    id: paSetup
    ColumnLayout {
        spacing: 15

        CheckBox{
            Layout.alignment: Qt.AlignLeft
            text: qsTr("Is_Dry_Run")
            implicitHeight: 30
            background: Rectangle{
                radius: 5
                gradient: Gradient{
                    GradientStop{
                        position: 0
                        color: "#101010"
                    }
                    GradientStop{
                        position: 1
                        color: "#909090"
                    }
                }
            }
            checked: paConfig.isDryRun
            onClicked: {
                paConfig.setIsDryRun(checked)
            }
        }

        RowLayout{
            XYModulePos{
                moduleName: "PickArmXY"
                posName: "StandbyPos"
            }

            SAxisModulePos{
                moduleName: "PickerZ1"
                posName: "StandbyPos"
            }

            SAxisModulePos{
                moduleName: "PickerZ2"
                posName: "StandbyPos"
            }
        }

        RowLayout{
            XYModulePos{
                moduleName: "PickArmXY"
                posName: "PAWaitForSutPos"
            }

            SAxisModulePos{
                moduleName: "PickerT1"
                posName: "StandbyPos"
            }

            SAxisModulePos{
                moduleName: "PickerT2"
                posName: "StandbyPos"
            }
        }

        RowLayout{
            ConfigRow{
                configName: "currentPickSenserUnitRowIndex"
                configModel: paConfig
                Component.onCompleted: {
                    autoInit()
                }
            }
            ConfigRow{
                configName: "currentPickSenserUnitColumnIndex"
                configModel: paConfig
                Component.onCompleted: {
                    autoInit()
                }
            }
        }

        RowLayout{
            ConfigRow{
                configName: "currentPickSenserRowIndexInside"
                configModel: paConfig
                Component.onCompleted: {
                    autoInit()
                }
            }
            ConfigRow{
                configName: "currentPickSenserColumnIndexInside"
                configModel: paConfig
                Component.onCompleted: {
                    autoInit()
                }
            }
        }

        Rectangle{
            color: "pink"
            width: 650
            height: 2
        }

        RowLayout{
            ConfigRow{
                configName: "currentPickLensUnitRowIndex"
                configModel: paConfig
                Component.onCompleted: {
                    autoInit()
                }
            }
            ConfigRow{
                configName: "currentPickLensUnitColumnIndex"
                configModel: paConfig
                Component.onCompleted: {
                    autoInit()
                }
            }
        }

        RowLayout{
            ConfigRow{
                configName: "currentPickLensRowIndexInside"
                configModel: paConfig
                Component.onCompleted: {
                    autoInit()
                }
            }
            ConfigRow{
                configName: "currentPickLensColumnIndexInside"
                configModel: paConfig
                Component.onCompleted: {
                    autoInit()
                }
            }
        }

        Rectangle{
            color: "pink"
            width: 650
            height: 2
        }

        RowLayout{
            ConfigRow{
                configName: "currentPlaceProductUintRowIndex"
                configModel: paConfig
                Component.onCompleted: {
                    autoInit()
                }
            }
            ConfigRow{
                configName: "currentPlaceProductUintColumnIndex"
                configModel: paConfig
                Component.onCompleted: {
                    autoInit()
                }
            }
        }

        RowLayout{
            ConfigRow{
                configName: "currentPlaceProductRowIndexInside"
                configModel: paConfig
                Component.onCompleted: {
                    autoInit()
                }
            }
            ConfigRow{
                configName: "currentPlaceProductColumnIndexInside"
                configModel: paConfig
                Component.onCompleted: {
                    autoInit()
                }
            }
        }
    }
}

